package week5;
import java.io.FileInputStream;
import java.util.Scanner;
import java.io.FileNotFoundException;

/**
 * Created by dell on 2017/3/24.
 */
public class FileUtil {
    public static String readFile(String name)
        throws FileNotFoundException {
            StringBuilder text = new StringBuilder();
            Scanner console = new Scanner (new FileInputStream(name));
            while (console.hasNext()) {
                text.append(console.nextLine())
                        .append('\n');
            }
            return text.toString();
        }

}
